import Vue from 'vue'
import App from './App.vue'
//导入路由
import VueRouter from 'vue-router'
//导入组件插件
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
//插件的使用
Vue.use(ElementUI)
Vue.use(VueRouter)
Vue.config.productionTip = false
//导入相对应的组件
import Discovery from './components/common/Discovery.vue'
import Songs from './components/common/Songs.vue'
import PlayLists from './components/common/PlayLists.vue'
import Mvs from './components/common/Mvs.vue'
import Result from './components/common/Result.vue'
// 解决导航栏或者底部导航tabBar中的vue-router在3.0版本以上频繁点击菜单报错的问题。
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
let router = new VueRouter({
	mode:'history',
	routes:[
		{//默认路由 默认首页
			path:'/discovery',
			component:Discovery
		},
		{//默认路由 默认首页
			path:'/',
			component:Discovery
		},
		{
			path:'/songs',
			component:Songs
		},
		{
			path:'/playLists',
			component:PlayLists
		},
		{
			path:'/mvs',
			component:Mvs
		},
		{
			path:'/result',
			component:Result
		}
		
	]
})
new Vue({
	router,
	render:h => h(App)
}).$mount('#app')


